<template>
    <div class="news">
      <div class="title">
       新闻资讯
      </div>
      <div class="sub-title">
        集研发、设计、销售为一体的现代高品质磨料磨具生产单位
      </div>
      <div class="news-main">
        <div class="left">
          <img src="https://proc58103-pic18.websiteonline.cn/upload/b518a7d2-0a6d-4548-b0b9-9c1fc686daeb.jpg" alt="">
        </div>
        <div class="right">
          <div v-for="(item, index) in listData" class="right-item" :key="index">
            <div class="wrap1" v-if="index === 0">
              <img v-if="item.url" :src="item.url" alt="">
              <div class="content">
                <div class="articleid">
                  {{item.title}}
                </div>
                <div class="desc">
                  {{item.desc}}
                </div>
                <div class="bot1">
                  <span class="detail">【详细】</span>
                </div>
                <div class="bot2">
                  <span class="time">{{item.time}}</span>
                </div>
              </div>
            </div>
            <div v-else class="wrap2">
              <div class="articleid">
                {{item.title}}
              </div>
              <span class="time">{{item.time}}</span>
            </div>
          </div>
        </div>
      </div>
      <div class="news-list">
        <div class="item" v-for="(item, index) in newList" :key="index">
          <div class="left">
            <div class="top">
              {{item.time.split(',')[1]}}
            </div>
            <div class="bot">
              {{item.time.split(',')[0]}}
            </div>
          </div>
          <div class="right">
            <div class="news-title">
              {{item.title}}
            </div>
            <div class="news-desc">
              {{item.desc}}
            </div>
          </div>
        </div>
      </div>
    </div>
  </template>
  
  <script>
  export default {
    name: "HomeChangXiao",
    data() {
      return {
        listData: [
          {
            url: 'https://proc58103-pic18.websiteonline.cn/upload/lwa6.jpg',
            title: '天然金刚石与人造金刚石的辨别',
            desc: '金刚砂是一种用途广泛的工业磨料，常用的是喷砂、水切割和地坪行业。现实中有的人习惯将这些行业用的砂子统称为金刚砂，但是它们有的是天然金刚砂有的却是人造金刚砂。',
            time: '2020-10-24'
          },
          {
            url: '',
            title: '白刚玉如何降低成本',
            desc: '',
            time: '2020-10-24'
          },
          {
            url: '',
            title: '耐火材料行业的发展',
            desc: '',
            time: '2020-10-24'
          },
          {
            url: '',
            title: '企业生产的磨料产品分类',
            desc: '',
            time: '2020-10-24'
          },
          {
            url: '',
            title: '玉发白刚玉获行业著名产品奖',
            desc: '',
            time: '2020-10-24'
          }
        ],
        newList: [
          {
            time: '2020-09,24',
            title: '中抛用α氧化铝系列',
            desc: '根据用户不同的要求，产品分三个系列：（1）YF-PA50G-'
          },
          {
            time: '2020-06,23',
            title: '郑州市企业联合会，企业家',
            desc: '稳经济增长促企业发展倡导书 郑州市企业联合会 郑州市'
          },
          {
            time: '2020-09,24',
            title: '天然金刚石与人造金刚石的辨',
            desc: '金刚砂是一种用途广泛的工业磨料，常用的是喷砂、水切割和地坪行'
          },
          {
            time: '2020-09,24',
            title: '紫蜡专用α氧化铝系列',
            desc: '本系列产品全部采用 1500 度以上天然气超高温回转窑煅烧'
          },
          {
            time: '2020-04,28',
            title: '第二届中国（长兴）耐火原料',
            desc: '第二届中国（长兴）耐火原料应用及高效供应链高峰论坛已于今日顺'
          },
          {
            time: '2020-09,24',
            title: '白刚玉如何降低成本',
            desc: '白刚玉属于人造磨料的一种，呈白色，其主要含三氧化二铝，并且含'
          }
        ]
      };
    },
    methods: {
    },
  };
  </script>
  
  <style lang="scss" scoped>
  .news {
    width: 1200px;
    margin: 0 auto;
    .title {
      width: 100%;
      text-align: center;
      font-size: 25px;
      color: #ce0909;
      margin-top: 80px;
      font-weight: bold;
    }

    .sub-title {
      width: 100%;
      text-align: center;
      color: #5A5A5A;
      font-size: 16px;
      font-style: normal;
      font-weight: normal;
      margin-top: 20px;
      margin-bottom: 80px;
      font-weight: bold;
    }
    .news-main {
      display: flex;
      .left {
        flex: 1;
        img{
          width: 100%;
          height: 346px;
        }
      }
      .right {
        flex: 1;
        background-color: rgb(250, 250, 250);
        padding: 20px;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        .right-item {
          cursor: pointer;
        }
        img {
          width: 130px;
          height: 90px;
          margin-right: 20px;
        }
        .wrap1 {
          display: flex;
          border-bottom: 1px dashed #eee;
          padding-bottom: 20px;
          padding-left: 0;
          .content {
            display: flex;
            flex-direction: column;
            justify-content: space-between;
            .articleid {
              display: inline-block;
              font-size: 18px;
              color: #5A5A5A;
              font-weight: bold;
              text-decoration: none;
            }
            .desc {
              display: block;
              font-size: 12px;
              color: #7D7D7D;
              font-weight: normal;
              text-decoration: none;
              line-height: 140%;
              margin-top: 4px;
            }
            .bot1 {
              display: flex;
              justify-content: flex-start;
              margin-top: 10px;
              .detail {
                display: inline-block;
                font-size: 12px;
                color: #CF0202;
                font-weight: normal;
                text-decoration: none;
              }
            }
            .bot2 {
              display: flex;
              justify-content: flex-end;
              margin-top: 20px;
              .time {
                display: inline-block;
                font-size: 12px;
                font-weight: normal;
                text-decoration: none;
              }
            }
          }
        }
        .wrap2 {
          padding-top: 10px;
          display: flex;
          justify-content: space-between;
          .articleid {
            display: inline-block;
            font-size: 14px;
            color: #5A5A5A;
          }
          .time {
            font-size: 12px;
            color: #9F9F9F;
            font-weight: normal;
          }
        }
      }
    }
    .news-list {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      justify-items: center;
      gap: 0 20px;
      margin-top: 50px;
      margin-bottom: 90px;
      .item {
        background-color: rgb(250, 250, 250);
        display: flex;
        padding: 30px;
        align-items: center;
        justify-content: center;
        .left {
          background: #7e7e7e;
          width: 60px;
          height: 59px;
          flex-shrink: 0; 
          margin-right: 20px;
          color: #fff;
          display: flex;
          flex-direction: column;
          .top {
            flex: 1.8;
            display: flex;
            justify-content: center;
            align-items: center;
            color: #fff;
            font-size: 24px;
            font-weight: bold;
          }
          .bot {
            flex: 1;
            display: flex;
            justify-content: center;
            align-items: center;
            font-size: 13px;
          }
        }
        .right {
          .news-title {
            font-size: 17px;
            color: #5A5A5A;
            font-weight: bold;
            text-decoration: none;
            line-height: 140%;
          }
          .news-desc {
            font-size: 12px;
            line-height: 16px;
            padding-top: 6px;
            color: #a7a7a7;
          }
        }
      }
      .item:nth-child(-n+3) {
        border-bottom: 1px dotted #dbd4cd;
      }
    }
  }
  </style>
  